<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Paypal订单支付状态</title>
</head>
<body>
    <p>这里是PayPal支付回调</p>
<script>
    var PAID_SUCCESS_CODE = 0;  // 成功
    var CANCEL_PAID = 10002;    // 取消
    var ERROR_PAID = 4032;      // 失败

    /**
     * app的交互处理
     * @param  {String} fn {交互的方法名}
     * @param  {Any} param {参数}
     */
    function handleApp(fn, param) {
        var req_param;
        if (typeof param === 'object') {
            req_param = JSON.stringify(param);
        } else {
            req_param = param;
        }

        alert(JSON.stringify(DIREWOLF));

        try { // for iOS
            window.webkit.messageHandlers[fn].postMessage(req_param);
            /* eslint-disable no-console */
            console.log('ios:', fn, param);
        } catch (e) { // for Android
            /* global DIREWOLF */ // for Android
            try {
                if (req_param) {
                    DIREWOLF[fn](req_param);
                } else {
                    DIREWOLF[fn]();
                }
            } catch (error) {
                console.log(error.message, fn, param);
                /* eslint-disable no-alert */
                alert(error);
            }
        }
    }
</script>
</body>
</html>